package com.gqb.ftp;

import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;

public class Ftptest {
	
	public static void main(String[] args) {
		FTPClient ftpClient=new FTPClient();
		try {
			int reply;
			ftpClient.connect("127.0.0.1", 211);
			ftpClient.login("admin", "gqb101112");
			reply=ftpClient.getReplyCode();
			if (!FTPReply.isPositiveCompletion(reply)) {
				ftpClient.disconnect();
			}
			ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
			ftpClient.setControlEncoding("gbk");
			System.out.println(ftpClient.mkd("doc"));
			System.out.println(ftpClient.makeDirectory("doc2/doc2"));
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
	
	
	public static void isDirectoryExist(FTPClient ftpClient){
		
	}
}
